<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      var stu = {}
      stu.sid = 'S1'
      stu.sname = 'zhang3'
      stu.age = 18
      stu.study = function () {
        console.log('=============stu=======study====11111=======')
      }

      console.log('学号:' + stu.sid)
      console.log('姓名:' + stu.sname)
      console.log('年龄:' + stu.age)
      stu.study()

      //简化写法
      var stu2 = {
        sid: 's1',
        sname: 'zhang3',
        age: 19,
        study: function () {
          console.log('=============stu=======study====22222222========')
        },
      }

      console.log('学号2:' + stu2.sid)
      console.log('姓名2:' + stu2.sname)
      console.log('年龄2:' + stu2.age)
      stu2.study()
    </script>
  </head>
  <body></body>
</html>
